//电子邮件puhalskijsemen@gmail.com
//源码网站 开vpn全局模式打开 http://web3incubators.com/
//电报https://t.me/gamecode999
var t = require;
var e = module;
var n = exports;
Object.defineProperty(n, "__esModule", {value: !0}), (n.getShareDD = n.getRewardDD = n.getBannerDD = void 0);
var o = t("BootConst"),
    r = t("TA"),
    a = t("WX");
(n.getBannerDD = function (t, e, n) {
    return (
        void 0 === t && (t = ""),
        void 0 === e && (e = ""),
        void 0 === n && (n = ""),
        {
            bannerShow: {ta_name: "bannerShow", ta_aparts: {userSets: ["CountNum"]}, wx_branchIds: t},
            bannerShowSuccess: {ta_name: "bannerShowSuccess", ta_aparts: {userSets: ["CountNum"]}, wx_branchIds: e},
            bannerShowFailed: {ta_name: "bannerShowFailed", ta_aparts: {userSets: ["CountNum"]}, wx_branchIds: n}
        }
    );
}),
    (n.getRewardDD = function (t, e, n, o, r) {
        return (
            void 0 === t && (t = ""),
            void 0 === e && (e = ""),
            void 0 === n && (n = ""),
            void 0 === o && (o = ""),
            void 0 === r && (r = ""),
            {
                rewardShow: {ta_name: "rewardShow", ta_aparts: {userSets: ["CountNum"]}, wx_branchIds: t},
                rewardDone: {ta_name: "rewardDone", ta_aparts: {userSets: ["CountNum"]}, wx_branchIds: e},
                rewardNotDone: {ta_name: "rewardNotDone", ta_aparts: {userSets: ["CountNum"]}, wx_branchIds: n},
                rewardError: {ta_name: "", wx_branchIds: o},
                share: {ta_name: "share", wx_branchIds: r}
            }
        );
    }),
    (n.getShareDD = function (t) {
        return void 0 === t && (t = ""), {share: {ta_name: "share", wx_branchIds: t}};
    });
var i = (function () {
    function t() {}
    return (
        (t.init = function () {
            for (var t in (r.default.init(),
            a.default.init(),
            (this.argss = new Array()),
            (this.names = new Array()),
            o.dd))
                switch (t) {
                    case "使用微信自定义场景行为":
                    case "使用微信测速":
                    case "ta_appIds":
                        break;
                    default:
                        this.checkArgs(o.dd[t], t, t, t);
                }
        }),
        (t.还有子级 = function (t) {
            for (var e in t) {
                switch (e) {
                    case "ta_aparts":
                    case "_wx_branchIds":
                        continue;
                }
                if ("object" == typeof t[e]) return !0;
            }
            return !1;
        }),
        (t.checkArgs = function (t, e, n, o) {
            if ((this.argss.push(t), this.names.push(e), this.还有子级(t)))
                for (var r in t) this.checkArgs(t[r], e, n + "_" + r, r);
            else {
                if ("wx_branchIds" in t) {
                    if (a.default.namesByBranchId && t.wx_branchIds) {
                        switch (((t._wx_branchIds = t.wx_branchIds.split(",")), t._wx_branchIds.length)) {
                            case 1:
                            case 2:
                                break;
                            default:
                                console.error("args._wx_branchIds.length=" + t._wx_branchIds.length + " != 2");
                        }
                        for (var i = 0, s = t._wx_branchIds; i < s.length; i++) {
                            var c = s[i];
                            a.default.namesByBranchId[c]
                                ? console.error("重复的 branchId：" + n + " " + c)
                                : (a.default.namesByBranchId[c] = n);
                        }
                    }
                } else console.error("木有 wx_branchIds：" + n);
                "ta_name" in t
                    ? t.ta_name && (t.ta_name == o || console.error("ta_name 和 key 不一致：" + n + " " + t.ta_name))
                    : console.error("木有 ta_name：" + n);
            }
        }),
        (t.setA = function (t) {
            (this.A = t), this.A ? this._setA(o.dd) : this._setB(o.dd);
        }),
        (t._setA = function (t) {
            if (this.还有子级(t)) for (var e in t) this._setA(t[e]);
            else t._wx_branchIds && (t._wx_branchIds.length = 1);
        }),
        (t._setB = function (t) {
            if (this.还有子级(t)) for (var e in t) this._setB(t[e]);
            else
                t._wx_branchIds &&
                    t._wx_branchIds.length > 1 &&
                    ((t._wx_branchIds[0] = t._wx_branchIds[1]), (t._wx_branchIds.length = 1));
        }),
        (t.stageStart = function (t, e, n) {
            (this.当前闯关章节索引 = t),
                (this.当前闯关副本索引 = e),
                (this.每章副本数 = n),
                (this.当前关卡数 = this.当前闯关章节索引 * this.每章副本数 + this.当前闯关副本索引 + 1),
                this.dd(o.dd.stage, {
                    action: "闯关开始",
                    chapter: this.当前闯关章节索引 + 1,
                    fuben: this.当前闯关副本索引 + 1,
                    level: this.当前关卡数
                });
        }),
        (t.stageEnd = function (t) {
            this.dd(o.dd.stage, {
                action: t ? "闯关成功" : "闯关失败",
                chapter: this.当前闯关章节索引 + 1,
                fuben: this.当前闯关副本索引 + 1,
                level: this.当前关卡数
            });
        }),
        (t.dd = function (t, e) {
            t.ta_name && r.default.dd(t, e),
                t._wx_branchIds &&
                    (e
                        ? a.default.reportUserBehaviorBranchAnalytics(
                              t._wx_branchIds[0],
                              e.index || 0,
                              e.wx_eventType || 1
                          )
                        : a.default.reportUserBehaviorBranchAnalytics(t._wx_branchIds[0], 0, 1));
        }),
        (t.getName = function (t) {
            var e = this.argss.indexOf(t);
            return e > -1 ? this.names[e] : "";
        }),
        t
    );
})();
n.default = i;
